sequenceDiagram
  Caller          ->>+ Resolvers: QueryResolver(repo, commit, file)
  Resolvers       ->>+ DB store: FindClosestDumps(repo, commit, file)
  DB store       -->>- Resolvers: dumps
  Resolvers      -->>- Caller: QueryResolver
  Caller          ->>+ QueryResolver: Definitions(repo, commit, file, position)

  loop for each dumps[i]
    QueryResolver     -->>+ Position adjuster: AdjustPosition(file, position, from: commit, to: dumps[i].commit)
    Position adjuster -->>- QueryResolver: adjusted file, adjusted position
    QueryResolver      ->>+ LSIF store: Definitions(dumps[i], adjusted file, adjusted position)
    LSIF store        -->>- QueryResolver: locations
  end

  alt if locations is empty
    loop for each dumps[i]
      QueryResolver    ->>+ LSIF store: MonikersByPosition(dump, adjusted file, adjusted position)
      LSIF store      -->>- QueryResolver: monikers
    end

    QueryResolver    ->>+ DB store: DefinitionDumps(monikers)
    DB store        -->>- QueryResolver: dumps

    QueryResolver    ->>+ LSIF store: BulkMonikerResults(monikers)
    LSIF store      -->>- QueryResolver: locations
  end

  QueryResolver     -->>+ Position adjuster: AdjustLocations(locations)
  Position adjuster -->>- QueryResolver: adjusted locations
  QueryResolver     -->>- Caller: adjusted locations
